import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        userInfo: JSON.parse(window.localStorage.getItem("userInfo")),
    },
    mutations: {
        updateUserInfo(state, data) {
            state.userInfo = data;
            window.localStorage.setItem("userInfo", JSON.stringify(data));
        },
    },
    actions: {},
    modules: {},
});
